package com.lmy.springboot.project.util;

import lombok.Getter;
import lombok.ToString;

/**
 * 自定义一个枚举类，指定返回给客户端的状态和信息
 */
@Getter
@ToString
public enum ResultEnum {

    OK(200, "success"),
    ERROR(500, "error"),
    ValidError(400, "后端校验失败");

    private int code;

    private String message;

    private ResultEnum() {

    }

    private ResultEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

}
